import request from '@/utils/request'

import {client} from '@/utils/tools'

//申请取消
export function usercancel(data) {
  return request.post("order/usercancel", data);
} 
//分配订单
export function serveok(data) {
  return request.post("order/serveok", data);
} 
//获得服务人员
export function GetShopAdmin(data) {
  return request.post("order/GetShopAdmin", data);
} 
//用户预约
export function userorder(data) {
  return request.post("order/userorder", data);
} 
//订单结算页
export function orderInfo(data) {
  return request.post("order/settlement", data);
} 
// 下单
export function orderBuy(data) {
  return request.post("order/submitOrder", data);
} 
//删除订单
export function delOrder(id) {
    return request.post('order/del', {id})
}
//新付订金/新增小件
export function firstlists(data) {
    return request.get('order/firstlists', {params: data})
}
//订单跟踪
export function shoplists(data) {
    return request.get('order/shoplists', {params: data})
}
//确认支付尾款
export function finalok(data) {
    return request.post('order/finalok', data)
}
//确认发货
export function deliveryok(data) {
    return request.post('order/deliveryok', data)
}
//确认收货
export function shippingok(data) {
    return request.post('order/shippingok', data)
}
//订单跟踪
export function installok(data) {
    return request.post('order/installok', data)
}
//订单列表
export function getOrderList(data) {
    return request.get('order/lists', {params: data})
}
//购物车和商品详情的地址
export function getaddress(data) {
    return request.get('cart/getaddress', {params: data})
}
//订单详情
export function getOrderDetail(id) {
    return request.get('order/getOrderDetail', {params: {id}})
}

//取消订单
export function cancelOrder(id) {
    return request.post('order/cancel', {id})
}

//物流
export function orderTraces(id) {
    return request.get("order/orderTraces", {params: {id}})
}

//确认收货
export function confirmOrder(id) {
    return request.post("order/confirm", {id})
}



// 支付结果
export function getPayResult(params) {
  return request.get("order/pay_result", { params });
} 
// 尾款支付结果
export function getfinalresult(params) {
  return request.get("order/pay_final_result", { params });
} 
